package org.umss.fixturebuilder.builder.model;

import java.util.LinkedList;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import org.umss.fixturebuilder.model.appengine.PhaseType;

/**
 *
 * @author Daniela Meneses
 */
@XmlRootElement
public class Phase {

    private List<Round> rounds;
    private PhaseType type;

    public Phase() {
        rounds = new LinkedList<Round>();
    }
    
    public Phase(PhaseType type) {
        rounds = new LinkedList<Round>();
        this.type = type;
    }

    public Phase(List<Round> rounds, PhaseType type) {
        this.rounds = rounds;
        this.type = type;
    }

    public PhaseType getType() {
        return type;
    }

    public void setType(PhaseType type) {
        this.type = type;
    }
    
    public List<Round> getRounds() { 
        return rounds;
    }

    public void setRounds(List<Round> rounds) {
        this.rounds = rounds;
    }
    
    public void addRound(Round round) {
        rounds.add(round);
    }

    @Override
    public String toString() {
        return "Fixture{\n" + rounds + "\n}";
    }
}
